package com.cosmo.demo;

public class DoubleLockSingleton {

    private volatile static DoubleLockSingleton doubleLock;

    private DoubleLockSingleton(){

    }

    public static DoubleLockSingleton getInstance(){
        if (doubleLock == null){
            synchronized (DoubleLockSingleton.class){
                if (doubleLock == null){
                    doubleLock = new DoubleLockSingleton();
                }
            }
        }
        return doubleLock;
    }

}
